/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * invulgotracker
 * Copyright (C) Thomas Andersen 2011 <thomas.1.andersen@gmail.com>
 * 
 * invulgotracker is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * invulgotracker is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _REPORT_H_
#define _REPORT_H_

#include <gtk/gtk.h>
#include "summary-view.h"
#include "detail-view.h"
#include "task-progress-view.h"
#include "balanceview.h"

class Report
{
public:
	static Report *GetReport();
	virtual ~Report();

	void Show();
        void Generate();
        void GenerateDetails();
        void GenerateTasks();
        void GenerateBalance();
        void Print();
protected:
	Report();

private:
        static void DrawPage(GtkPrintOperation *operation,GtkPrintContext *context, gint page_nr, gpointer user_data);
        static void BeginPage(GtkPrintOperation *operation,GtkPrintContext *context, gpointer user_data);
        static void DrawDetailPage(GtkPrintOperation *operation,GtkPrintContext *context, gint page_nr, gpointer user_data);
        static void BeginDetailPage(GtkPrintOperation *operation,GtkPrintContext *context, gpointer user_data);
        static void DrawTaskPage(GtkPrintOperation *operation,GtkPrintContext *context, gint page_nr, gpointer user_data);
        static void BeginTaskPage(GtkPrintOperation *operation,GtkPrintContext *context, gpointer user_data);
        static void DrawBalancePage(GtkPrintOperation *operation,GtkPrintContext *context, gint page_nr, gpointer user_data);
        static void BeginBalancePage(GtkPrintOperation *operation,GtkPrintContext *context, gpointer user_data);
        void PrintPage(GtkPrintOperation *operation,GtkPrintContext *context, gint page_nr, gpointer user_data);
        void PrintBegin(GtkPrintOperation *operation,GtkPrintContext *context, gpointer user_data);
        void PrintDetailPage(GtkPrintOperation *operation,GtkPrintContext *context, gint page_nr, gpointer user_data);
        void PrintDetailBegin(GtkPrintOperation *operation,GtkPrintContext *context, gpointer user_data);
        void PrintTaskPage(GtkPrintOperation *operation,GtkPrintContext *context, gint page_nr, gpointer user_data);
        void PrintTaskBegin(GtkPrintOperation *operation,GtkPrintContext *context, gpointer user_data);
        void PrintBalancePage(GtkPrintOperation *operation,GtkPrintContext *context, gint page_nr, gpointer user_data);
        void PrintBalanceBegin(GtkPrintOperation *operation,GtkPrintContext *context, gpointer user_data);

        glong linesPerPage;
        gdouble maxWidth,maxWidthDate, maxWidthTime, maxWidthUsed, maxWidthPct;
	GtkWidget *window;
	static Report *singleton;
        SummaryView *summaryView;
        DetailView *detailView;
        TaskProgressView *taskProgressView;
        BalanceView *balanceView;
};

#endif // _REPORT_H_
